home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
CMPLTPAS
/
FACTRIAL.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-05-05
|
344b
|
13 lines
{<<<< Factorial >>>>}
{ From: COMPLETE TURBO PASCAL by Jeff Duntemann }
{ Scott, Foresman & Co. 1986 ISBN 0-673-18600-8 }
{ Described in section 14.4 -- Last mod 2/1/86 }
{ Overflows for all N > 7 }
FUNCTION Factorial(N : Integer) : Integer;
BEGIN
IF N > 1 THEN Factorial := N * Factorial(N-1)
ELSE Factorial := 1
END;